<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'north'" class="center">
        <div class="webmap">
            <p class="webmaptip">当前位置:</p>
            <a href="javascript:;" class="easyui-link" data-options="plain:true">奖励管理</a>
            <p class="webmaptip">></p>
            <a href="javascript:;" class="easyui-link" data-options="plain:true">所有奖励</a>
        </div>
        <div class="querybycon">
            <form id="query">
                <div class="queryinfo">
                    <div>奖励说明<input type="text" name="title"></div>
                    <div>开始日期<input name="beginTime" class="easyui-datetimebox"></div>
                    <div>结束日期<input name="endTime" class="easyui-datetimebox"></div>
                    <div>奖励类型<input class="easyui-combobox" name="type"
                                    data-options="url:'/dictionary/userBonusType?all=true'"></div>

                    <div class="query">
                        <a id="querybtn" href="javascript:;" class="easyui-linkbutton  "
                           data-options="iconCls:'fa fa-search'"></a>
                    </div>
                </div>
            </form>
        </div>
        <div class="querybtn">
            <a id="add" href="javascript:;" class="easyui-linkbutton  warning"
               data-options="iconCls:'fa fa-plus'">添加</a>
            <a id="edit" href="javascript:;" class="easyui-linkbutton danger"
               data-options="iconCls:'fa fa-pencil'">编辑</a>
            <a id="del" href="javascript:;" class="easyui-linkbutton success"
               data-options="iconCls:'fa fa-remove'">删除</a>
            <div style="visibility: hidden;">aa</div>
        </div>

    </div>
    <div data-options="region:'center'" class="center">
        <table id="list"></table>
    </div>
</div>


<script type="text/javascript">
    var edit = "/bonus/edit";
    var addUrl = "/page/bonus/bonusadd.html";
    var editUrl = "/page/bonus/bonusedit.html";
    var delUrl = '/bonus/del';
    var save = '/bonus/save';
    var listUrl = "/bonus/list";
    var columns = [[{
        field: 'id',
        checkbox: true
    }, {
        field: 'code',
        title: '编码',
        width: "125px",
    }, {
        field: 'title',
        title: '奖励说明',
        width: "125px",
    }, {
        field: 'type',
        title: '奖励类型',
        width: "125px",
        formatter: function (value, row, index) {
            if (value) {
                if (value == '1') {
                    return '特权本金';
                } else if (value == '2') {
                    return '加息卷';
                } else if (value == '3') {
                    return '现金券';
                }
            }
        }
    }, {
        field: 'usePlantfrom',
        title: '使用平台',
        width: "125px",
        formatter: function (value, row, index) {
            var plantform = [];
            plantform["1"] = "PC";
            plantform["2"] = "H5";
            plantform["3"] = "APP";
            var txt = [];
            if (value) {
                var values = value.split(",");
                for (i in values) {
                    txt.push(plantform[values[i]]);
                }
            }
            return txt.join(",");
        }
    }, {
        field: 'getPlantfrom',
        title: '获取平台',
        width: "125px",
        formatter: function (value, row, index) {
            var plantform = [];
            plantform["1"] = "PC";
            plantform["2"] = "H5";
            plantform["3"] = "APP";
            var txt = [];
            if (value) {
                var values = value.split(",");
                for (i in values) {
                    txt.push(plantform[values[i]]);
                }
            }
            return txt.join(",");
        }
    }, {
        field: 'productType',
        title: '产品类型',
        width: "300px",
        formatter: function (value, row, index) {
            var plantform = [];
            plantform["1"] = "车辆周转袋";
            plantform["2"] = "房产周转贷";
            plantform["3"] = "个人消费贷";
            plantform["4"] = "个体经营贷";
            plantform["5"] = "农业贷";
            plantform["6"] = "企业经营贷";
            var txt = [];
            if (value) {
                var values = value.split(",");
                for (i in values) {
                    txt.push(plantform[values[i]]);
                }

            }
            return txt.join(",");

        }
    }, {
        field: 'beginTime',
        title: '开始日期',
        width: "125px",
    }, {
        field: 'endTime',
        title: '结束日期',
        width: "125px",
    }, {
        field: 'targetIds',
        title: '标的类型',
        width: "125px",
        formatter: function (value, row, index) {
            var plantform = [];
            plantform["1"] = "普通标";
            plantform["2"] = "新手标";
            var txt = [];
            if (value) {
                var values = value.split(",");
                for (i in values) {
                    txt.push(plantform[values[i]]);
                }

            }
            return txt.join(",");

        }

    }]];
    list.init({url: listUrl, columns: columns});
</script>
